<!DOCTYPE html>
<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<span id=test></span>
<div id="console"></div>
<script>
description('Check focused shadow node dispatchs blur event on removeChild of host.');
var logs = [];
var test = document.getElementById('test');
var shadow = test.attachShadow({mode: 'open'});
var input = document.createElement("input");
shadow.appendChild(input);
input.addEventListener('blur', function () { logs.push('blur'); });
input.focus();
logs.push('start-removeChild');
test.parentNode.removeChild(test);
logs.push('end-removeChild');
shouldBeEqualToString('logs.toString()', 'start-removeChild,blur,end-removeChild');
</script>
</body>
</html>
